package org.jeecg.modules.charge.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.enums.meter.RefundStatusEnum;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: 订单表
 * @Author: jeecg-boot
 * @Date: 2019-08-15
 * @Version: V1.0
 */
@Data
@TableName("charge_bills_order")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "charge_bills_order对象", description = "订单表")
public class ChargeBillsOrder {

    /**
     * 编号
     */
    @TableId(type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "编号")
    private java.lang.String id;
    /**
     * 订单号
     */
    @Excel(name = "订单号", width = 15)
    @ApiModelProperty(value = "订单号")
    private java.lang.String sn;
    /**
     * 交易订单号
     */
    @ApiModelProperty(value = "交易订单号")
    private java.lang.String transactionNumber;
    /**
     * 社区编号
     */
    @ApiModelProperty(value = "社区编号")
    private java.lang.String projectId;
    /**
     * 楼栋编号
     */
    @ApiModelProperty(value = "楼栋编号")
    private java.lang.String floorId;
    /**
     * 房间编号
     */
    @ApiModelProperty(value = "房间编号")
    private java.lang.String roomId;
    /**
     * 缴费者姓名
     */
    @Excel(name = "缴费用户", width = 15)
    @ApiModelProperty(value = "缴费用户")
    private java.lang.String name;
    /**
     * 手机
     */
    @ApiModelProperty(value = "手机")
    private java.lang.String mobile;
    /**
     * 会员编号
     */
    @ApiModelProperty(value = "会员编号")
    private java.lang.String userId;
    /**
     * 收费项目ID
     */
    @ApiModelProperty(value = "收费项目ID")
    @TableField(exist = false)
    private java.lang.String feeitemId;
    /**
     * 支付金额
     */
    @Excel(name = "实付金额", width = 15)
    @ApiModelProperty(value = "实付金额")
    private java.lang.Double payFee;
    /**
     * 应收金额
     */
    @Excel(name = "应付金额", width = 15)
    @ApiModelProperty(value = "应付金额")
    private BigDecimal payDue;
    /**
     * 优惠金额
     */
    @Excel(name = "减免金额", width = 15)
    @ApiModelProperty(value = "减免金额")
    private BigDecimal payReduced;

    @ApiModelProperty(value = "支付方式")
    @Dict(dicCode = "pay_type")
    private Integer payType;

    @Excel(name = "收款模式", width = 15, dicCode = "pay_mode")
    @ApiModelProperty(value = "支付类型'offline'线下支付，'alipay'支付宝，'wxpay'微信支付")
    @Dict(dicCode = "pay_mode")
    private String payMode;
    /**
     * 支付状态
     */
    @Excel(name = "支付状态", width = 15, dicCode = "pay_status")
    @ApiModelProperty(value = "支付状态")
    @Dict(dicCode = "pay_status")
    private java.lang.Integer payStatus;
    /**
     * 支付时间
     */
    @Excel(name = "缴费时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "缴费时间")
    private java.util.Date payTime;
    /**
     * 物业订单确认状态，0未确认，1已确认，2已关闭，3退款或删除
     */
    @ApiModelProperty(value = "物业订单确认状态，0未确认，1已确认，2已关闭，3退款或删除")
    private java.lang.Integer status;
    /**
     * 校验收款管理员id
     */
    @ApiModelProperty(value = "校验收款管理员id")
    private java.lang.String verifyAdminId;
    /**
     * 发票号码
     */
    @ApiModelProperty(value = "发票号码")
    private java.lang.String invoice;
    /**
     * 发票类型 0:纸质发票,1:电子发票
     */
    @ApiModelProperty(value = "发票类型 0:纸质发票,1:电子发票")
    private java.lang.String invoiceType;
    /**
     * 发票抬头表id
     */
    @ApiModelProperty(value = "发票抬头表id")
    private java.lang.String invoiceTitleId;
    /**
     * 发票抬头姓名
     */
    @ApiModelProperty(value = "发票抬头姓名")
    private java.lang.String invoiceName;
    /**
     * 发票抬头手机
     */
    @ApiModelProperty(value = "发票抬头手机")
    private java.lang.String invoiceMobile;
    /**
     * 发票抬头邮箱
     */
    @ApiModelProperty(value = "发票抬头邮箱")
    private java.lang.String invoiceEmail;
    /**
     * 账号
     */
    @ApiModelProperty(value = "账号")
    private java.lang.String invoiceAccount;
    /**
     * 税号
     */
    @ApiModelProperty(value = "税号")
    private java.lang.String invoiceEin;
    /**
     * 发票抬头地址
     */
    @ApiModelProperty(value = "发票抬头地址")
    private java.lang.String invoiceAddress;
    /**
     * delFlag
     */
    @TableLogic
    @ApiModelProperty(value = "删除标记")
    private java.lang.String delFlag;
    /**
     * 创建订单时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建订单时间")
    private java.util.Date createTime;
    /**
     * 请求参数
     */
    @ApiModelProperty(value = "请求参数")
    private java.lang.Object request;

    @ApiModelProperty(value = "银行渠道")
    private String payChannel;
    /**
     * 响应参数
     */
    @ApiModelProperty(value = "响应参数")
    private java.lang.Object response;

    /**
     * 1物业费2停车费3水电费
     */
//    @Excel(name = "1物业费2停车费3水电费", width = 15)
//    @ApiModelProperty(value = "1物业费2停车费3水电费")
//    private java.lang.String billType;

    @ApiModelProperty(value = "退款状态0:未退款 1:已退款")
    private Integer refundStatus;

    @TableField(exist = false)
    @Excel(name = "退款状态", width = 15)
    private String refundStatusStr;

    @ApiModelProperty(value = "退款日期")
    @Excel(name = "退款日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    private Date refundTime;

    @ApiModelProperty(value = "退款者")
    private String refundBy;

    private String createBy;

    @ApiModelProperty(value = "创建者名")
    @TableField(exist = false)
    private String createByName;

    /**
     * 账单ID
     */
    @ApiModelProperty(value = "账单ID")
    private String billids;

    /*项目名*/
    @TableField(exist = false)
    @Excel(name = "项目名称", width = 15)
    private java.lang.String projectName;
    /*楼宇名*/
    @TableField(exist = false)
    @Excel(name = "楼宇名称", width = 15)
    private java.lang.String floorName;
    /*房间名*/
    @TableField(exist = false)
    @Excel(name = "房间名称", width = 15)
    private java.lang.String roomName;
    /*费用类型*/
    @TableField(exist = false)
    @Excel(name = "收款方式", width = 15)
    private java.lang.String typeName;
    /*维修部位*/
    @TableField(exist = false)
    private java.lang.String contents;
    /*材料费*/
    @TableField(exist = false)
    private java.lang.String repairMaterialFee;
    /*工时费*/
    @TableField(exist = false)
    private java.lang.String repairManHourfee;
    /*收费项目*/
    @TableField(exist = false)
    private java.lang.String feeName;
    /*开始日期*/
    @TableField(exist = false)
    private String startRq;
    /*结束日期*/
    @TableField(exist = false)
    private String endRq;
    /*支付日期：例2019-09*/
    @TableField(exist = false)
    private java.lang.String payCny;
    /*支付状态：例支付成功，支付中*/
    @TableField(exist = false)
    private java.lang.String paymentStatus;
    /*收款方物业公司名称*/
    @TableField(exist = false)
    private java.lang.String companyName;

    /*手机端开票状态*/
    @TableField(exist = false)
    private String invoiceStatus;

    /*账单说明*/
    @TableField(exist = false)
    private String billsRemarks;

    /*发票地址*/
    @TableField(exist = false)
    private String pdfUrl;

    /*公司ID*/
    @TableField(exist = false)
    private String tenantId;

    /*发票号码*/
    @TableField(exist = false)
    private String fphm;

    /*发票号码*/
    @TableField(exist = false)
    private String[] projectIds;

    /*发票号码*/
    @TableField(exist = false)
    private String subOpenId;

    /*收费项目名称*/
    @TableField(exist = false)
    @Excel(name = "收费项目", width = 15)
    private String feeItemName;

    public String getRefundStatusStr() {
        return RefundStatusEnum.getDesc(this.refundStatus);
    }
}
